import { Component, Vue, Ref } from 'vue-property-decorator'
import { Form as ElForm } from 'element-ui'
@Component({
  name: 'oprate'
})
export default class extends Vue {
  private isOpen = false
  @Ref() private readonly formRef!: ElForm
  public open () {
    this.isOpen = true
    if (this.formRef) {
      // 打开弹窗时清楚校验
      this.formRef.clearValidate()
    }
  }

  public close () {
    this.isOpen = false
  }

  public handleClose (done: () => void) {
    this.close()
    done()
  }
}
